﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DbGenerator.Model.units.table;

namespace DbExecuter.DataLayer.commands
{
    public class TFromClause
    {
        #region ctors
        public TFromClause(TTable fromTable)
        {
            _FromTable = fromTable;
        }
        #endregion

        #region overriden methods
        public override string ToString()
        {
            return String.Format("FROM [{0}].[{1}].[{2}] AS [{3}]"
                , _FromTable.BaseCatalog.DatabaseName
                , _FromTable.TableSchema
                , _FromTable.TableSign.TableName
                , _FromTable.TableSign.TableAlias);
        }
        #endregion

        #region properties
        private TTable _FromTable;
        public TTable FromTable
        {
            get { return _FromTable; }
        }
        #endregion
    }
}
